package Acm;

import java.util.Scanner;

public class AGamewithMultiset {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int[] arr=new int[100];
        boolean[] arrB=new boolean[100];
        int n=sc.nextInt();
        int max=Integer.MIN_VALUE;
        boolean jishu=false;
        for (int i = 0; i < n; i++) {
           int choice=sc.nextInt();
           if(choice==1){
               int tmp=sc.nextInt();
               arr[tmp]+=1;
               max=Math.max(tmp,max);
           }
           else{
               int n2=sc.nextInt();
               String bStr = Integer.toBinaryString(n2);
               if(n2==0){
                   System.out.println("YES");
                   continue;
               }
               //把数组搞好

               if(max==Integer.MIN_VALUE){
                   System.out.println("NO");
                   continue;
               }
               for (int j = 0; j < max; j++) {
                   if(arr[j]>1){
                       arrB[j]=true;
                       arr[j+1]+=arr[j]/2;
                       arr[j]%=2;
                   }
               }
               int tmp=max;
               while(tmp<100&&arr[tmp]>1){
                   arrB[tmp]=true;
                   arr[tmp+1]+=arr[tmp]/2;
                   arr[tmp]%=2;
                   tmp++;
               }

               int len=bStr.length()-1;
               boolean isOk=true;
               for (int l = 0; l < bStr.length(); l++) {
                   if(bStr.charAt(l)=='1'){
                       if(arr[len-l]!=1&&!arrB[len-l]){
                           System.out.println("NO");
                           isOk=false;
                           break;
                       }
                   }
               }
               if(isOk){
                   System.out.println("YES");
               }
           }
        }
        System.out.println();
    }
}
